%% Author: Dmitriid
%% Created: 20.09.2006
%% Description: TODO: Add desciption to orcas_tools
-module(orcas_tools).

%%
%% Include files
%%

%%
%% Exported Functions
%%
-export([save_to_file/2, request_login_info/0]).

%%
%% API Functions
%%

save_to_file(PathToFile, Data) -> 
	case file:open(PathToFile, [read, write]) of 
		{ok, IoDevice} ->
			case io:fwrite(IoDevice, "~p", [Data]) of
				ok ->
					file:close(IoDevice),
					io:fwrite("File successfully written to ~s~n", [PathToFile]),
					ok;
				_ ->
					file:close(IoDevice),
					io:fwrite("File NOT written to ~s~n", [PathToFile]),
					{error, "File not written"}
			end;
		{error, Reason} ->
			{error, Reason} 
	end.

request_login_info() ->
    {ok, UserName} = io:read("Enter user name: "),
    {ok, Password} = io:read("Enter password: "),
    {UserName, Password}.

%%
%% Local Functions
%%

